#ifndef MARKER_H
#define MARKER_H

#include <QSharedDataPointer>
#include "shredmateengine_global.h"

#include <QHash>
#include <QUuid>

class MarkerData;

class SHREDMATEENGINESHARED_EXPORT Marker
{
public:
    Marker();
    Marker(qint64 position);
    Marker(qint64 position, QString name);
    Marker(const Marker &);
    Marker &operator=(const Marker &);
    bool operator ==(const Marker& rhs) const;
    bool operator <(const Marker& rhs) const;

    ~Marker();

    QUuid uuid() const;

    void setPosition(qint64 position);
    qint64 position() const;

    void setName(QString name);
    QString name() const;

    bool isValid() const;

private:
    QExplicitlySharedDataPointer<MarkerData> data;
};

inline uint qHash(const Marker &key)
{
    return qHash(key.name()) ^ key.position();
}

QDataStream& operator<<(QDataStream& stream, const Marker& marker);
QDataStream& operator>>(QDataStream& stream, Marker& marker);

#endif // MARKER_H
